import React from "react"
import { Empty } from "@taroify/core"

type ImagePreset = "default" | "error" | "search" | "network"
interface EmptyProps {
  className?: string
  style?: React.CSSProperties
}
interface ImageProps extends EmptyProps {
  src?: ImagePreset | string
  /** 是否开启预览模式 */
  preview?: boolean
}
interface IProps {
  description?: React.ReactNode
  imageProps?: ImageProps
  emptyProps?: EmptyProps
}
const GpEmpty: React.FC<IProps> = ({
  description = "暂无数据",
  imageProps = { src: "default" },
  children = null,
  emptyProps = {}
}) => {
  return (
    <Empty {...emptyProps}>
      <Empty.Image {...imageProps} />
      <Empty.Description>{description}</Empty.Description>
      {children}
    </Empty>
  )
}
export default GpEmpty
